package com.gome.wechat.program.controller;

import com.gome.wechat.program.common.consts.TagType;
import com.gome.wechat.program.entity.Tag;
import com.gome.wechat.program.service.TagService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by liwei113 on 2017/10/31 0031.
 */
@Api("标签服务")
@RestController
@RequestMapping(value = "/tag", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class TagController {

    @Autowired
    TagService tagService;

    @ApiOperation(value = "获取个人爱好列表",response = Tag.class, notes = "开发by李巍")
    @GetMapping(value = "/hobby")
    List<Tag> getHobbyTags(){
        List<Tag> tags =  tagService.findByType(TagType.HOBBY.value());
        return tags;
    };

    @ApiOperation(value = "获取活动标签列表",response = Tag.class, notes = "开发by李巍")
    @GetMapping(value = "/activity")
    List<Tag> getActivityTags(){
        List<Tag> tags =  tagService.findByType(TagType.ACTIVITY.value());
        return tags;
    };
}
